package com.note.simpleadmin.entity;

import javax.persistence.*;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.Objects;

/***
 *@ClaseName:TbCart
 *
 *@Decription:
 *
 *@Author: xubingbing
 *
 *@Date:2019/1/27 0027 14:14
 */
@Entity
@Table(name = "tb_cart", schema = "simpleshop", catalog = "")
public class TbCart {
    private long id;
    private Timestamp addTime;
    private String goodsId;
    private String goodsSpecId;
    private Integer isDelete;
    private Integer num;
    private BigDecimal price;
    private String userId;

    @Id
    @Column(name = "id")
    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    @Basic
    @Column(name = "add_time")
    public Timestamp getAddTime() {
        return addTime;
    }

    public void setAddTime(Timestamp addTime) {
        this.addTime = addTime;
    }

    @Basic
    @Column(name = "goods_id")
    public String getGoodsId() {
        return goodsId;
    }

    public void setGoodsId(String goodsId) {
        this.goodsId = goodsId;
    }

    @Basic
    @Column(name = "goods_spec_id")
    public String getGoodsSpecId() {
        return goodsSpecId;
    }

    public void setGoodsSpecId(String goodsSpecId) {
        this.goodsSpecId = goodsSpecId;
    }

    @Basic
    @Column(name = "is_delete")
    public Integer getIsDelete() {
        return isDelete;
    }

    public void setIsDelete(Integer isDelete) {
        this.isDelete = isDelete;
    }

    @Basic
    @Column(name = "num")
    public Integer getNum() {
        return num;
    }

    public void setNum(Integer num) {
        this.num = num;
    }

    @Basic
    @Column(name = "price")
    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    @Basic
    @Column(name = "user_id")
    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        TbCart tbCart = (TbCart) o;
        return id == tbCart.id &&
                Objects.equals(addTime, tbCart.addTime) &&
                Objects.equals(goodsId, tbCart.goodsId) &&
                Objects.equals(goodsSpecId, tbCart.goodsSpecId) &&
                Objects.equals(isDelete, tbCart.isDelete) &&
                Objects.equals(num, tbCart.num) &&
                Objects.equals(price, tbCart.price) &&
                Objects.equals(userId, tbCart.userId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, addTime, goodsId, goodsSpecId, isDelete, num, price, userId);
    }
}
